<template>
  <div>
    <h1>敏感词过滤</h1>
    <div>
      <el-tag class="ml-2" type="danger" v-for="item in words" :key="item">{{item}}</el-tag>
    </div>
    <el-input v-model="input" placeholder="Please input" @input="inputVal" />
  </div>
</template>

<script setup lang="ts">
import Mint from "mint-filter";
import { ref } from "vue";
const words = ["脑残", "废物", "白痴", "三八", "智障"];
const mint = new Mint(words);
const input = ref<string>("");
const inputVal = () => {
  input.value = mint.filter(input.value).text;
  console.log(1, mint.filter(input.value));
};
</script>

<style scoped>
</style>